/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controller;

import models.AccountBO;
import myconfession.dao.AccountDAO;
import myconfession.dto.account.Account;

/**
 *
 * @author BAOLA
 */

public class EditInfoAction {
    private String username;
   private String password;
   private String firstname;
   private String lastname;
   private String email;

    public EditInfoAction() {
    }

    public String execute() throws Exception {
        Account acc = new Account();
        acc.setUsername(username);
        acc.setPassword(password);
        acc.setFirstname(firstname);
        acc.setLastname(lastname);
        acc.setEmail(email);

        AccountBO.updateToXml(acc);
        return "success";
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @param username the username to set
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the firstname
     */
    public String getFirstname() {
        return firstname;
    }

    /**
     * @param firstname the firstname to set
     */
    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    /**
     * @return the lastname
     */
    public String getLastname() {
        return lastname;
    }

    /**
     * @param lastname the lastname to set
     */
    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

}